﻿///<reference path="jquery-1.4.3.min.js" />
///<reference path="kooboo.js" />
///<reference path="kooboo.webcontrols.js" />
///<reference path="tiny_mce.js" />


function __initHtmlEditor(ui, defautValues,id) {
    kooboo.webcontrols[ui] = {
        val: function (value) {
            if (value == undefined) {
                return $("#" + ui).val();
            } else {
                $("#" + ui).val(value);
            }
        },
        html: function (html) {
            this.val(html);
        },
        reset: function () {
          
            this.val(defautValues);
        },
        id: id
    };
}

$(function () {
    $(".ui-htmleditor").each(function (index, item) {
        tinyMCE.init({
            theme: "advanced",
            mode: "exact",
            elements: $(item).attr("id"),
            plugins: "fullscreen,searchreplace", //autoresize
            theme_advanced_toolbar_location: "top",
            theme_advanced_toolbar_align: "left",
            theme_advanced_buttons1: "search,replace,undo,redo,|,image,link,unlink,charmap,|,bold,italic,fontselect,forecolor,backcolor,|,numlist,bullist,formatselect,|,code,fullscreen",
            theme_advanced_buttons2: "",
            theme_advanced_buttons3: ""
        });
    });
});
    
